package com.xjtu.se.homework.client.userInfo.dao;

import com.xjtu.se.homework.client.userInfo.UserDto;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Mapper
@Repository
public interface UserInfoDao {
    @Select("select * from sys_user where u_id=#{u_id}")
    List<UserDto> checkId(String u_id);

    @Update("update sys_user set u_name=#{u_name} where u_id=#{u_id}")
    boolean modName(String u_id, String u_name);

    @Update("update sys_user set role_id=#{role_id}, grade=#{grade} where u_id=#{u_id}")
    boolean modRole(String u_id, int role_id, String grade);
}
